****************** First Destination: ****************** Var tmpDateStr: String; Const ctMaxFilesAllowed = 50; Begin psExitCode := 1; // Check new Month tmpDateStr := FormatDateTime('mmm', Now); If Not SameText(tmpDateStr, psVSA) Then Begin psVSA := tmpDateStr; psVIA := 0; End Else Begin If (psVIA > ctMaxFilesAllowed) And (psCounter = 0) Then psVIA := 0; End; // ... add your code here If psVIA > ctMaxFilesAllowed Then Begin psExitCode := 0; psLogWrite(1, '', 'Reached Max files Allowed'); End; End. ****************** Third Destination: ****************** Begin psExitCode:= 1; // Increase "Integer Value A" when Output is successfull psVIA := psVIA + 1; End.